<?php
/**
 * Created by PhpStorm.
 * User: Guangpeng Chen
 * Date: 14-11-9
 * Time: 下午8:58
 */
include 'config.inc.php';
$remoteIds = array (
    0 => '101',
    1 => '259',
    2 => '260',
    3 => '158',
    4 => '1396',
    5 => '3218',
    6 => '3219',
    7 => '3220',
    8 => '3221',
    9 => '3339',
);

$sql = "SELECT l.id,l.title,l.apply_did,l.salerid,l.addtime,p.id,p.p_status FROM uu_land l LEFT JOIN uu_products p ON p.contact_id=l.id WHERE l.apply_did=94 AND l.title='闽清白岩山'";

$sql=<<<SQL
select f.lid,t.id,t.title,t.pid,t.delaydays,t.notes,t.ddays,t.reb,f.dhour,
f.startplace,f.endplace,f.tourist_info,f.ass_station,f.series_model,
t.apply_did as aid from uu_jq_ticket as t
left join uu_land_f as f on t.id=f.tid
left join uu_products p on p.id=t.pid
where p.p_status=0 and p.apply_limit=1
SQL;
try {
    $stmt = $pdo->prepare($sql);
    $stmt->execute();
    print_r($stmt->fetchAll(PDO::FETCH_ASSOC));
} catch (PDOException $e) {
    echo $e->getMessage();
}

exit;
//$rids = implode(',', $remoteIds);
//$insert = <<<SQL
//update INTO get_Product_Fromt_Action SET account='100014',product_ids='{$rids}',
//t_get=1,rectime=now() where id=13 LIMIT 1
//SQL;
//ECHO $insert;
//$pdo->exec($insert);
//    echo $pdo->lastInsertId() . PHP_EOL;
//foreach ($remoteIds as $rid) {
//
//
//}

//exit;
//$sql_desc = "DESC get_Product_Fromt_Lib";
//$stmt = $pdo->prepare($sql_desc);
//$stmt->execute();
//print_r ($stmt->fetchAll(PDO::FETCH_ASSOC));

$insert = <<<SQL
insert uu_jq_ticket set `title`= '老人票',`tprice`= '3500',`getaddr`= '下级价格套用测试',`pay`= '1',`storage`= '-1',`cancel_auto_onMin`= '',`delaytype`= '0',`delaydays`= '30',`order_end`= '0',`ddays`= '1',`reb`= '0',`buy_limit_low`= '1',`buy_limit_up`= '0',`apply_did`= '94',`landid`= '3999'
SQL;
$pdo->exec($insert);
echo $pdo->lastInsertId();
exit;